<?php
include 'checkLogin.php';
@$worker_id = $_REQUEST['worker_id'];
@$img = $_REQUEST['file'];
@$name = $_REQUEST['name'];
@$age = $_REQUEST['age'];
@$sex = $_REQUEST['sex'];
@$phone = $_REQUEST['phone'];
@$location = $_REQUEST['location'];
//move_uploaded_file($img['tmp_name'], 'img/worker/'.$img['name']);

if(empty($worker_id)||empty($name)||empty($age)||empty($sex)||empty($phone)||empty($location)){
	$mes = "都不能为空";
	include 'ediWorkerBasic.php';
	die;
}
include 'db/li.php';
@$flog = dbUpdate('update worker set name=:name,age=:age,sex=:sex,phone=:phone,location=:location where id=:id',
					array('name'=>$name,'age'=>$age,'sex'=>$sex,'phone'=>$phone,'location'=>$location,'id'=>$worker_id));
if(!$flog){
	$mes = "修改失败";
	include 'ediWorkerBasic.php';
	die;
}
header('Refresh:0;url=index.php');